//
//  DetailView.m
//  ZYShang
//
//  Created by wangguangming on 15/7/28.
//  Copyright © 2015年 Amber. All rights reserved.
//

#import "DetailView.h"
#import "Base.h"
@implementation DetailView
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
        {
        self.backgroundColor=COLOR;
        [self addall];
        }
    return self;
}
-(void)addall
{
    UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 64, WIDTH, 45)];
    view.backgroundColor=[UIColor whiteColor];
    [self addSubview:view];
    
    self.detailButton=[[UIButton alloc] initWithFrame:CGRectMake(0, 0, WIDTH/2-1, 40)];
    [self.detailButton setTitle:@"订单详情" forState:UIControlStateNormal];
    
    self.orderLogButton=[[UIButton alloc] initWithFrame:CGRectMake(WIDTH/2+1, 0, WIDTH/2-1, 40)];
    
    [self.orderLogButton setTitle:@"订单日志" forState:UIControlStateNormal];
    [self.detailButton setTitleColor:BLUECOLOL forState:UIControlStateNormal];
    [self.orderLogButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    
    UILabel *l=[[UILabel alloc] initWithFrame:CGRectMake(WIDTH/2-1, 10, 2, 20)];
    l.backgroundColor=COLOR;
    [view addSubview:l];
    
    self.detailLab=[[UILabel alloc] initWithFrame:CGRectMake(6, 42, WIDTH/2-11, 2)];
    self.detailLab.backgroundColor=BLUECOLOL;
    [view addSubview:self.detailLab];
    
    self.orderLab=[[UILabel alloc] initWithFrame:CGRectMake(WIDTH/2+6, 42, WIDTH/2-11, 2)];
    self.orderLab.backgroundColor=[UIColor whiteColor];
    [view addSubview:self.orderLab];
    
    
    self.mainTable=[[UITableView alloc] init];
    self.mainTable.frame=CGRectMake(0, CGRectGetMaxY(view.frame)+3, WIDTH, HEIGHT-110);
    self.mainTable.backgroundColor=COLOR;
    
    self.mainTable.separatorStyle = UITableViewCellSelectionStyleNone;
    [view addSubview:self.detailButton];
    [view addSubview:self.orderLogButton];
    [self addSubview:self.mainTable];    
}
@end
